using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using Model;

namespace TanHungLong.Report
{
    public partial class rpNhanVien : DevExpress.XtraReports.UI.XtraReport
    {
        public rpNhanVien(object[] arrBOList, RNhanVienBO nhanVienBO)
        {
            InitializeComponent();


            int i = -1;
            DanhMucBOList quocTichBOList = (DanhMucBOList)arrBOList[++i];
            DanhMucBOList danTocBOList = (DanhMucBOList)arrBOList[++i];
            DanhMucBOList tonGiaoBOList = (DanhMucBOList)arrBOList[++i];
            DanhMucBOList chuyenMonBOList = (DanhMucBOList)arrBOList[++i];
            DanhMucBOList trinhDoHocVanBOList = (DanhMucBOList)arrBOList[++i];
            DanhMucBOList trinhDoNgoaiNguBOList = (DanhMucBOList)arrBOList[++i];
            DanhMucBOList bangCapBOList = (DanhMucBOList)arrBOList[++i];
            DanhMucBOList trinhDoTinHocBOList = (DanhMucBOList)arrBOList[++i];

            int? _value = null;
            _value = StaticUtil.GetRealInt(nhanVienBO.QuocTichID);
            if (_value != null)
                if (quocTichBOList.ContainsKey(_value))
                    nhanVienBO.QuocTichID = quocTichBOList.Value(_value);
                else
                    nhanVienBO.QuocTichID = null;

            _value = StaticUtil.GetRealInt(nhanVienBO.DanTocID);
            if (_value != null)
                if (danTocBOList.ContainsKey(_value))
                    nhanVienBO.DanTocID = danTocBOList.Value(_value);
                else
                    nhanVienBO.DanTocID = null;

            _value = StaticUtil.GetRealInt(nhanVienBO.TonGiaoID);
            if (_value != null)
                if (tonGiaoBOList.ContainsKey(_value))
                    nhanVienBO.TonGiaoID = tonGiaoBOList.Value(_value);
                else
                    nhanVienBO.TonGiaoID = null;

            _value = StaticUtil.GetRealInt(nhanVienBO.ChuyenMonID);
            if (_value != null)
                if (chuyenMonBOList.ContainsKey(_value))
                    nhanVienBO.ChuyenMonID = chuyenMonBOList.Value(_value);
                else
                    nhanVienBO.ChuyenMonID = null;

            _value = StaticUtil.GetRealInt(nhanVienBO.TrinhDoHocVanID);
            if (_value != null)
                if (trinhDoHocVanBOList.ContainsKey(_value))
                    nhanVienBO.TrinhDoHocVanID = trinhDoHocVanBOList.Value(_value);
                else
                    nhanVienBO.TrinhDoHocVanID = null;

            _value = StaticUtil.GetRealInt(nhanVienBO.TrinhDoNgoaiNguID);
            if (_value != null)
                if (trinhDoNgoaiNguBOList.ContainsKey(_value))
                    nhanVienBO.TrinhDoNgoaiNguID = trinhDoNgoaiNguBOList.Value(_value);
                else
                    nhanVienBO.TrinhDoNgoaiNguID = null;

            _value = StaticUtil.GetRealInt(nhanVienBO.BangCapID);
            if (_value != null)
                if (bangCapBOList.ContainsKey(_value))
                    nhanVienBO.BangCapID = bangCapBOList.Value(_value);
                else
                    nhanVienBO.BangCapID = null;

            _value = StaticUtil.GetRealInt(nhanVienBO.TrinhDoTinHocID);
            if (_value != null)
                if (trinhDoTinHocBOList.ContainsKey(_value))
                    nhanVienBO.TrinhDoTinHocID = trinhDoTinHocBOList.Value(_value);
                else
                    nhanVienBO.TrinhDoTinHocID = null;

            this.bdSource.DataSource = nhanVienBO;
        }
    }
}
